$(function () {
    obj.init();
});

var obj = new function () {
    'use strict';
    return {
        dataGrid: null,
        userId:null,
        sLogonName:null,
        form:null,
        params: {
        },
        init: function () {
            this.userId = xhTool.getQuery('userIds');
            this.form = new xhForm($('#xh_form'));

            this.listener();
        },
        listener: function () {
            var $this = this;
            $('#iSchoolId').select2();
            //修改学校
            //提交按钮
            $('#bt_modal_confirm',parent.document).click(function () {
                $this.funObj().submit();
            });
        },
        funObj: function () {
            var $this = this;
            return {
                submit: function () {
                    $this.form.submit('User/modifySchool',{iUserId:$this.userId},function (res) {
                        // if(xhExtra.checkError(res)){
                        //     return false;
                        // }
                        window.top.xhTop.showSuccess(res.msg);
                        window.top.xhTop.closeModal();
                        xhExtra.backToList($this.dataGrid);
                        // window.top.xhTop.getActiveFrame().obj.dataGrid.reload();
                    },{check:false})

                }
            }
        }
    }
};